import { API } from '@/services/model/baseModel';
import { WalletModel, BalanceModel } from '@/services/model/walletModel';
import config from '@/utils/config';
import { request } from '@/utils/http';

/**
 * 我的资产
 * @returns
 */
const getMyWallet = () => {
  return request.get<API<Array<WalletModel>>>(config.url.wallet);
};

/**
 * 我的余额
 * @returns 余额
 */
const getBalance = () => {
  return request.get<API<BalanceModel>>(config.url.wallet_balance);
};

/**
 * 充值
 * @param money 金额
 * @returns
 */
const rechargeMoney = (money: number) => {
  return request.post<API<String>>(config.url.wallet_recharge, { money: money });
};

export { getMyWallet, getBalance, rechargeMoney };
